import pickle as pkl
import random as rd
from copy import copy

from enigma import CHARS


def generate_wheel():
    chars_input = copy(CHARS)
    chars_output = copy(CHARS)
    rd.shuffle(chars_output)
    
    return list(zip(chars_input, chars_output))


# def generate_reflector():
#     chars_input = copy(CHARS)
#     chars_output = CHARS[int(len(CHARS) / 2):] + CHARS[:int(len(CHARS) / 2)]
    
#     return list(zip(chars_input, chars_output))
all_wheels = []
for i in range(8):
    wheel = generate_wheel()
    all_wheels.append(wheel)
print(all_wheels)
with open('wheels.pkl', 'wb') as fo:
    fo.write(pkl.dumps(all_wheels))
